package service

import (
	"aglaia/internal/model"
)

type FirstOrCreateTagRequest struct {
	Name string `json:"name"`
}

func (svc *Service) FirstOrCreateTag(tag FirstOrCreateTagRequest) (model.Tag, error) {
	return svc.dao.FirstOrCreateTag(tag.Name)
}

type DeleteTagRequest struct {
	Id uint `json:"id"`
}

func (svc *Service) DeleteTag(tag DeleteTagRequest) error {
	return svc.dao.DeleteTag(tag.Id)
}

func (svc *Service) Tags() ([]model.Tag, error) {
	return svc.dao.Tags()
}
